<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解忧 - 让心声被听见</title>
    
    <!-- 现代化字体 -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500;600&family=Noto+Sans+SC:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    
    <!-- 高级CSS框架和组件库 -->
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css" rel="stylesheet">
    
    <!-- 现代化图标库 -->
    <link href="https://cdn.jsdelivr.net/npm/@tabler/icons@latest/icons-sprite.svg" rel="stylesheet">
    <script src="https://unpkg.com/feather-icons"></script>
    
    <!-- 动画库 -->
    <link href="https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.12.2/dist/gsap.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/lottie-web@5.12.2/build/player/lottie.min.js"></script>
    
    <!-- 粒子效果 -->
    <script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>
    
    <!-- 现代化工具库 - 移除framer-motion，使用原生动画 -->
    
    <!-- 自定义现代化样式 -->
    <link href="css/modern-ui.css" rel="stylesheet">
    
    <style>
        :root {
            --primary-color: #2563eb;
            --primary-dark: #1d4ed8;
            --secondary-color: #7c3aed;
            --accent-color: #06b6d4;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --error-color: #ef4444;
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-tertiary: #f1f5f9;
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border-color: #e2e8f0;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.6;
        }

        /* 主容器 */
        .app-container {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* 顶部导航栏 */
        .navbar {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border-color);
            padding: 1rem 0;
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .navbar-brand {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .navbar-brand i {
            font-size: 1.75rem;
        }

        .navbar-center {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
            justify-content: center;
        }

        .model-selector-container {
            position: relative;
        }

        .model-selector {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            padding: var(--space-sm) var(--space-lg);
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            border: 1px solid var(--border-light);
            cursor: pointer;
            transition: all var(--transition-normal);
            position: relative;
            box-shadow: var(--shadow-xs);
            font-weight: 500;
        }

        .model-selector:hover {
            background: var(--bg-primary);
            border-color: var(--primary);
            box-shadow: var(--shadow-glow);
            transform: translateY(-1px);
        }

        .model-selector i {
            color: var(--primary);
            transition: all var(--transition-normal);
        }

        .model-selector span {
            font-weight: 600;
            color: var(--text-primary);
            letter-spacing: 0.01em;
        }

        .model-dropdown {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            width: 320px;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            z-index: var(--z-dropdown);
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-normal);
            margin-top: var(--space-sm);
            backdrop-filter: blur(20px);
        }

        .model-dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(4px);
        }

        .model-dropdown-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-secondary);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        }

        .model-dropdown-header span {
            font-weight: 600;
            color: var(--text-primary);
        }

        .model-dropdown-close {
            background: transparent;
            border: none;
            color: var(--text-muted);
            width: 24px;
            height: 24px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .model-dropdown-close:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .model-dropdown-content {
            padding: 0.5rem;
            max-height: 300px;
            overflow-y: auto;
        }

        .model-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            border-radius: var(--radius-lg);
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 0.25rem;
        }

        .model-item:hover {
            background: var(--bg-secondary);
        }

        .model-item.current {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
        }

        .model-item-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            background: var(--bg-tertiary);
            color: var(--text-secondary);
        }

        .model-item.current .model-item-icon {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .model-item-info {
            flex: 1;
        }

        .model-item-name {
            font-weight: 500;
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }

        .model-item-description {
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.3;
        }

        .model-item.current .model-item-description {
            color: rgba(255, 255, 255, 0.8);
        }

        .model-item-status {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            border-radius: var(--radius-sm);
            background: var(--success-color);
            color: white;
        }

        .user-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
            position: relative;
        }

        /* 用户头像容器 */
        .user-avatar-container {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem;
            border-radius: var(--radius-lg);
            cursor: pointer;
            transition: all 0.3s ease;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            position: relative;
        }

        .user-avatar-container:hover {
            background: var(--bg-tertiary);
            border-color: var(--primary-color);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1rem;
        }

        .user-name {
            font-weight: 500;
            color: var(--text-primary);
            font-size: 0.875rem;
        }

        .user-dropdown-arrow {
            color: var(--text-muted);
            font-size: 0.75rem;
            transition: transform 0.3s ease;
        }

        .user-avatar-container:hover .user-dropdown-arrow {
            transform: rotate(180deg);
        }

        /* 用户下拉菜单 */
        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            width: 320px;
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            z-index: 1001;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            margin-top: 0.5rem;
        }

        .user-dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        /* 用户信息头部 */
        .user-dropdown-header {
            padding: 1.5rem;
            background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
            border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .user-avatar-large {
            position: relative;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
        }

        .vip-badge {
            position: absolute;
            bottom: -2px;
            right: -2px;
            background: #ff6b35;
            color: white;
            font-size: 0.625rem;
            font-weight: 600;
            padding: 0.125rem 0.375rem;
            border-radius: var(--radius-sm);
            border: 2px solid white;
        }

        .user-info {
            flex: 1;
        }

        .user-name-large {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 1rem;
            margin-bottom: 0.25rem;
        }

        .user-status {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .user-actions-small {
            display: flex;
            gap: 0.5rem;
        }

        .btn-icon {
            width: 28px;
            height: 28px;
            border-radius: var(--radius-md);
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-icon:hover {
            background: rgba(255, 255, 255, 0.3);
            color: var(--text-primary);
        }

        /* 会员特权区域 */
        .member-privileges {
            padding: 1rem 1.5rem;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .member-title {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }

        .member-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .upgrade-btn {
            background: linear-gradient(135deg, #ff6b35, #f7931e);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: var(--radius-md);
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .upgrade-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
        }

        /* 设置选项 */
        .user-settings {
            padding: 1rem 1.5rem;
        }

        .setting-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 0;
            cursor: pointer;
            transition: all 0.3s ease;
            border-radius: var(--radius-md);
            color: var(--text-primary);
        }

        .setting-item:hover {
            background: var(--bg-secondary);
        }

        .setting-item i {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 0.875rem;
        }

        .setting-item span {
            flex: 1;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .setting-value {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .settings-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .settings-grid .setting-item {
            padding: 0.5rem;
            font-size: 0.75rem;
        }

        /* 退出登录区域 */
        .logout-section {
            padding: 0.5rem 1.5rem 1.5rem;
            border-top: 1px solid var(--border-color);
        }

        .logout-item {
            color: var(--text-muted);
            font-size: 0.875rem;
        }

        .logout-item:hover {
            color: var(--text-primary);
            background: var(--bg-secondary);
        }

        /* 未登录状态按钮 */
        .btn-download-app {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            color: var(--text-primary);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-download-app:hover {
            border-color: var(--primary-color);
            background: var(--bg-secondary);
        }

        .btn-download-app i {
            color: var(--text-muted);
        }

        .btn-login {
            padding: 0.5rem 1.5rem;
            background: var(--text-primary);
            color: white;
            border: none;
            border-radius: var(--radius-lg);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-login:hover {
            background: var(--text-secondary);
            transform: translateY(-1px);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border: none;
            border-radius: var(--radius-lg);
            padding: 0.75rem 1.5rem;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .btn-outline {
            border: 2px solid var(--border-color);
            background: transparent;
            color: var(--text-secondary);
            border-radius: var(--radius-lg);
            padding: 0.75rem 1.5rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .btn-outline:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background: rgba(99, 102, 241, 0.05);
        }

        /* 主内容区域 */
        .main-content {
            flex: 1;
            padding: 3rem 0;
            position: relative;
        }

        /* 右上角用户个人中心 */
        .user-center-top-right {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 1000;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        /* 移动端适配 */
        @media (max-width: 768px) {
            .user-center-top-right {
                top: 0.5rem;
                right: 0.5rem;
                gap: 0.5rem;
            }
            
            .user-dropdown {
                width: 280px;
                right: -1rem;
            }
            
            .user-avatar-container {
                padding: 0.375rem;
            }
            
            .user-name {
                display: none;
            }
            
            .btn-download-app {
                padding: 0.375rem 0.75rem;
                font-size: 0.75rem;
            }
            
            .btn-login {
                padding: 0.375rem 1rem;
                font-size: 0.75rem;
            }
        }

        .container {
            max-width: 1400px;
            padding: 0 2rem;
        }

        /* 欢迎区域 */
        .welcome-section {
            text-align: center;
            margin-bottom: 5rem;
            padding: 3rem 0;
        }

        .welcome-title {
            font-size: 4rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 2rem;
            line-height: 1.1;
            letter-spacing: -0.02em;
        }

        .welcome-subtitle {
            font-size: 1.5rem;
            color: var(--text-secondary);
            margin-bottom: 4rem;
            max-width: 900px;
            margin-left: auto;
            margin-right: auto;
            font-weight: 400;
            line-height: 1.6;
        }

        /* 搜索框 */
        .search-container {
            max-width: 900px;
            margin: 0 auto 4rem;
            position: relative;
        }

        .search-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .search-box {
            width: 100%;
            padding: 1.5rem 4rem 1.5rem 2rem;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-2xl);
            background: var(--bg-primary);
            font-size: 1.125rem;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
            min-height: 60px;
        }

        .search-box:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        .search-box::placeholder {
            color: var(--text-muted);
            font-size: 1.125rem;
        }

        .search-icon {
            position: absolute;
            left: 1.5rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 1.25rem;
            pointer-events: none;
        }

        .search-btn {
            position: absolute;
            right: 3rem;
            top: 50%;
            transform: translateY(-50%);
            background: var(--primary-color);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0;
            visibility: hidden;
        }

        .search-btn.show {
            opacity: 1;
            visibility: visible;
        }

        .search-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-50%) scale(1.05);
        }

        .search-clear-btn {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: var(--text-muted);
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0;
            visibility: hidden;
        }

        .search-clear-btn.show {
            opacity: 1;
            visibility: visible;
        }

        .search-clear-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        /* 搜索建议下拉菜单 */
        .search-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            margin-top: 0.5rem;
            max-height: 400px;
            overflow: hidden;
        }

        .search-suggestions.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .search-suggestions-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-secondary);
        }

        .search-suggestions-header span {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.875rem;
        }

        .search-suggestions-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .search-suggestions-close,
        .refresh-cache-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            width: 24px;
            height: 24px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .search-suggestions-close:hover,
        .refresh-cache-btn:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .refresh-cache-btn:hover {
            color: var(--primary-color);
        }

        .search-suggestions-content {
            max-height: 300px;
            overflow-y: auto;
        }

        .search-suggestion-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            border-bottom: 1px solid var(--border-color);
        }

        .search-suggestion-item:hover {
            background: var(--bg-secondary);
        }

        .search-suggestion-item:last-child {
            border-bottom: none;
        }

        .search-suggestion-avatar {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-lg);
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .search-suggestion-info {
            flex: 1;
        }

        .search-suggestion-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 1rem;
            margin-bottom: 0.25rem;
        }

        .search-suggestion-description {
            color: var(--text-secondary);
            font-size: 0.875rem;
            line-height: 1.4;
        }

        .search-suggestion-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .search-suggestion-tag {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            padding: 0.25rem 0.5rem;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
        }

        .search-no-results {
            padding: 2rem 1.5rem;
            text-align: center;
            color: var(--text-muted);
        }

        .search-no-results i {
            font-size: 2rem;
            margin-bottom: 1rem;
            display: block;
        }

        .search-no-results p {
            margin: 0;
            font-size: 0.875rem;
        }

        /* 搜索高亮样式 */
        .search-suggestion-name mark,
        .search-suggestion-description mark {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 0.125rem 0.25rem;
            border-radius: var(--radius-sm);
            font-weight: 600;
        }

        /* 功能建议按钮 */
        .feature-suggestions {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            margin-bottom: 4rem;
            flex-wrap: wrap;
        }

        .feature-btn {
            padding: 0.75rem 1.5rem;
            background: var(--bg-primary);
            border: 2px solid var(--border-color);
            border-radius: var(--radius-xl);
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .feature-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background: rgba(99, 102, 241, 0.05);
            transform: translateY(-2px);
        }

        .feature-btn i {
            font-size: 1rem;
        }

        /* 精选人物卡片区域 */
        .feature-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2.5rem;
            margin-bottom: 4rem;
            max-width: 1200px;
            margin-left: auto;
            margin-right: auto;
        }

        .featured-character-card {
            background: var(--bg-primary);
            border-radius: var(--radius-2xl);
            padding: 2rem;
            border: 1px solid var(--border-color);
            transition: all 0.4s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            min-height: 320px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
            backdrop-filter: blur(10px);
        }

        .featured-character-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
            transform: scaleX(0);
            transition: transform 0.4s ease;
        }

        .featured-character-card::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: rotate(45deg);
            transition: all 0.6s ease;
            opacity: 0;
        }

        .featured-character-card:hover {
            transform: translateY(-12px) scale(1.02);
            box-shadow: var(--shadow-xl);
            border-color: var(--primary-color);
            background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
        }

        .featured-character-card:hover::before {
            transform: scaleX(1);
        }

        .featured-character-card:hover::after {
            opacity: 1;
            animation: shimmer 1.5s ease-in-out;
        }

        .featured-character-header {
            display: flex;
            align-items: center;
            gap: 1.25rem;
            margin-bottom: 1.5rem;
        }

        .featured-character-avatar {
            width: 80px;
            height: 80px;
            border-radius: var(--radius-xl);
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2rem;
            font-weight: 600;
            flex-shrink: 0;
            box-shadow: var(--shadow-lg);
            position: relative;
            overflow: hidden;
        }

        .featured-character-avatar::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transform: rotate(45deg);
            transition: all 0.6s ease;
            opacity: 0;
        }

        .featured-character-card:hover .featured-character-avatar::before {
            opacity: 1;
            animation: avatarShimmer 1.5s ease-in-out;
        }

        .featured-character-info h3 {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .featured-character-info p {
            color: var(--text-secondary);
            font-size: 1rem;
            margin: 0;
            font-weight: 500;
        }

        .featured-character-description {
            color: var(--text-secondary);
            font-size: 1rem;
            line-height: 1.6;
            margin-bottom: 1.5rem;
        }

        .featured-character-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .featured-character-tag {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 0.5rem 1rem;
            border-radius: var(--radius-lg);
            font-size: 0.875rem;
            font-weight: 500;
            box-shadow: var(--shadow-sm);
        }

        /* 换一批按钮 */
        .refresh-section {
            display: flex;
            justify-content: center;
            margin-bottom: 4rem;
        }

        .refresh-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            background: var(--bg-primary);
            border: 2px solid var(--border-color);
            border-radius: var(--radius-xl);
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
        }

        .refresh-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background: rgba(37, 99, 235, 0.05);
            transform: translateY(-2px);
        }

        .refresh-btn i {
            font-size: 1rem;
            transition: transform 0.3s ease;
        }

        .refresh-btn:hover i {
            transform: rotate(180deg);
        }

        /* 角色网格 */
        .characters-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
            gap: 2.5rem;
            margin-bottom: 5rem;
            max-width: 1400px;
            margin-left: auto;
            margin-right: auto;
        }

        .character-card {
            background: var(--bg-primary);
            border-radius: var(--radius-2xl);
            padding: 2rem;
            border: 1px solid var(--border-color);
            transition: all 0.4s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
            backdrop-filter: blur(10px);
        }

        .character-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
            transform: scaleX(0);
            transition: transform 0.4s ease;
        }

        .character-card::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: rotate(45deg);
            transition: all 0.6s ease;
            opacity: 0;
        }

        .character-card:hover {
            transform: translateY(-12px) scale(1.02);
            box-shadow: var(--shadow-xl);
            border-color: var(--primary-color);
            background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
        }

        .character-card:hover::before {
            transform: scaleX(1);
        }

        .character-card:hover::after {
            opacity: 1;
            animation: shimmer 1.5s ease-in-out;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        .character-header {
            display: flex;
            align-items: center;
            gap: 1.25rem;
            margin-bottom: 1.5rem;
        }

        .character-avatar {
            width: 80px;
            height: 80px;
            border-radius: var(--radius-xl);
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2rem;
            font-weight: 600;
            flex-shrink: 0;
            box-shadow: var(--shadow-lg);
            position: relative;
            overflow: hidden;
        }

        .character-avatar::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transform: rotate(45deg);
            transition: all 0.6s ease;
            opacity: 0;
        }

        .character-card:hover .character-avatar::before {
            opacity: 1;
            animation: avatarShimmer 1.5s ease-in-out;
        }

        @keyframes avatarShimmer {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        .character-info h3 {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .character-info p {
            color: var(--text-secondary);
            font-size: 1rem;
            margin: 0;
            font-weight: 500;
        }

        .character-description {
            color: var(--text-secondary);
            font-size: 1rem;
            line-height: 1.6;
            margin-bottom: 1.5rem;
        }

        .character-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .tag {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 0.5rem 1rem;
            border-radius: var(--radius-lg);
            font-size: 0.875rem;
            font-weight: 500;
            box-shadow: var(--shadow-sm);
        }

        /* 聊天界面 */
        .chat-container {
            background: var(--bg-primary);
            border-radius: var(--radius-2xl);
            box-shadow: var(--shadow-xl);
            overflow: hidden;
            height: 80vh;
            display: flex;
            flex-direction: column;
        }

        .chat-header {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .chat-character-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .chat-character-avatar {
            width: 50px;
            height: 50px;
            border-radius: var(--radius-xl);
            background: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            font-weight: 600;
        }

        .chat-character-details h4 {
            margin: 0;
            font-size: 1.25rem;
            font-weight: 600;
        }

        .chat-character-details p {
            margin: 0;
            opacity: 0.8;
            font-size: 0.875rem;
        }

        .chat-close-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .chat-close-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .chat-messages {
            flex: 1;
            padding: 1.5rem;
            overflow-y: auto;
            background: var(--bg-secondary);
        }

        .message {
            margin-bottom: 1rem;
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
        }

        .message.user {
            flex-direction: row-reverse;
        }

        .message-avatar {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .message.user .message-avatar {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
        }

        .message.assistant .message-avatar {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
        }

        .message-content {
            max-width: 70%;
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            padding: 0.75rem 1rem;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .message.user .message-content {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
        }

        .message-text {
            margin: 0;
            line-height: 1.5;
        }

        .message-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .skill-badge {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            font-weight: 500;
            margin-right: 0.25rem;
        }

        .skill-knowledge { background: #dbeafe; color: #1e40af; }
        .skill-emotion { background: #fce7f3; color: #be185d; }
        .skill-creative { background: #f3e8ff; color: #7c3aed; }
        .skill-memory { background: #dcfce7; color: #166534; }
        .skill-analyze { background: #fef3c7; color: #d97706; }

        .play-btn {
            background: var(--bg-tertiary);
            border: none;
            color: var(--text-secondary);
            width: 32px;
            height: 32px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .play-btn:hover {
            background: var(--primary-color);
            color: white;
        }

        /* 输入区域 */
        .chat-input-area {
            padding: 1.5rem;
            background: var(--bg-primary);
            border-top: 1px solid var(--border-color);
        }

        .ai-skills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .skill-selector {
            padding: 0.75rem 1.25rem;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
            background: var(--bg-primary);
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .skill-selector:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            background: rgba(99, 102, 241, 0.05);
        }

        .skill-selector.active {
            border-color: var(--primary-color);
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .input-group {
            display: flex;
            gap: 0.75rem;
            align-items: flex-end;
        }

        .message-input {
            flex: 1;
            padding: 1rem 1.5rem;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-xl);
            background: var(--bg-primary);
            font-size: 1.125rem;
            transition: all 0.3s ease;
            resize: none;
            min-height: 60px;
            max-height: 150px;
        }

        .message-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        .message-input::placeholder {
            color: var(--text-muted);
            font-size: 1.125rem;
        }

        .input-actions {
            display: flex;
            gap: 0.5rem;
        }

        .btn-send {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border: none;
            color: white;
            width: 60px;
            height: 60px;
            border-radius: var(--radius-xl);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
            font-size: 1.25rem;
        }

        .btn-send:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .btn-voice {
            background: var(--bg-tertiary);
            border: 2px solid var(--border-color);
            color: var(--text-secondary);
            width: 60px;
            height: 60px;
            border-radius: var(--radius-xl);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            font-size: 1.25rem;
        }

        .btn-voice:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .btn-voice.recording {
            background: var(--error-color);
            border-color: var(--error-color);
            color: white;
            animation: pulse 1s infinite;
        }

        /* 语音通话按钮特殊样式 */
        #voiceCallBtn {
            background: linear-gradient(135deg, #10a37f, #0d8b6c);
            border-color: #10a37f;
            color: white;
        }

        #voiceCallBtn:hover {
            background: linear-gradient(135deg, #0d8b6c, #0a6b54);
            border-color: #0d8b6c;
            color: white;
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        /* 模态框样式 */
        .modal-content {
            border: none;
            border-radius: var(--radius-2xl);
            box-shadow: var(--shadow-xl);
        }

        .modal-header {
            border-bottom: 1px solid var(--border-color);
            padding: 1.5rem;
        }

        .modal-title {
            font-weight: 600;
            color: var(--text-primary);
        }

        .modal-body {
            padding: 1.5rem;
        }

        .form-control {
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: 0.75rem 1rem;
            transition: all 0.3s ease;
        }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .welcome-title {
                font-size: 2rem;
            }
            
            .characters-grid {
                grid-template-columns: 1fr;
            }
            
            .chat-container {
                height: 90vh;
            }
            
            .message-content {
                max-width: 85%;
            }
        }

        /* 滚动条样式 */
        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-tertiary);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        /* 加载动画 */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid var(--border-color);
            border-radius: 50%;
            border-top-color: var(--primary-color);
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 隐藏元素 */
        .hidden {
            display: none !important;
        }

        /* 页面加载动画 */
        .fade-in {
            animation: fadeIn 0.8s ease-out;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 卡片进入动画 */
        .card-enter {
            animation: cardEnter 0.6s ease-out;
        }

        @keyframes cardEnter {
            from {
                opacity: 0;
                transform: translateY(40px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* 按钮点击动画 */
        .btn-click {
            animation: btnClick 0.2s ease-out;
        }

        @keyframes btnClick {
            0% { transform: scale(1); }
            50% { transform: scale(0.95); }
            100% { transform: scale(1); }
        }

        /* 悬浮效果增强 */
        .hover-lift {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .hover-lift:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }

        /* 渐变文字效果 */
        .gradient-text {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        /* 左侧侧边栏 */
        .sidebar {
            position: fixed;
            top: 0;
            left: -320px;
            width: 320px;
            height: 100vh;
            background: var(--bg-primary);
            border-right: 1px solid var(--border-color);
            box-shadow: var(--shadow-xl);
            transition: left 0.3s ease;
            z-index: 1001;
            overflow-y: auto;
        }

        .sidebar.open {
            left: 0;
        }

        .sidebar-header {
            padding: 1.5rem 1rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--bg-primary);
        }

        .sidebar-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin: 0;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .sidebar-logo {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1rem;
            font-weight: 600;
        }

        .sidebar-close-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            width: 32px;
            height: 32px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .sidebar-close-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .sidebar-content {
            padding: 1rem;
        }

        .sidebar-section {
            margin-bottom: 1.5rem;
        }

        .sidebar-search {
            position: relative;
            margin-bottom: 1rem;
        }

        .sidebar-search i {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 0.875rem;
        }

        .sidebar-search-input {
            width: 100%;
            padding: 0.75rem 0.75rem 0.75rem 2.5rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            background: var(--bg-secondary);
            font-size: 0.875rem;
            color: var(--text-primary);
            transition: all 0.3s ease;
        }

        .sidebar-search-input:focus {
            outline: none;
            border-color: var(--primary-color);
            background: var(--bg-primary);
        }

        .sidebar-search-input::placeholder {
            color: var(--text-muted);
        }


        .sidebar-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: var(--radius-md);
            transition: all 0.3s ease;
        }

        .sidebar-section-header:hover {
            background: var(--bg-secondary);
        }

        .sidebar-section-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
        }

        .sidebar-section-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .sidebar-toggle-icon {
            transition: transform 0.3s ease;
            color: var(--text-muted);
        }

        .sidebar-section-header.expanded .sidebar-toggle-icon {
            transform: rotate(180deg);
        }

        .sidebar-content-list {
            margin-bottom: 1rem;
            max-height: 300px;
            overflow-y: auto;
        }

        .sidebar-pagination {
            text-align: center;
            margin-top: 0.5rem;
        }

        .sidebar-pagination-btn {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            padding: 0.5rem 1rem;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0 auto;
            font-size: 0.875rem;
        }

        .sidebar-pagination-btn:hover {
            background: var(--bg-secondary);
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        /* 人物列表项样式 */
        .sidebar-character-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.3s ease;
            background: var(--bg-primary);
        }

        .sidebar-character-item:hover {
            border-color: var(--primary-color);
            background: rgba(37, 99, 235, 0.05);
        }

        .sidebar-character-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }

        .sidebar-character-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .sidebar-character-info {
            flex: 1;
            min-width: 0;
        }

        .sidebar-character-name {
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-character-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-refresh-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            width: 24px;
            height: 24px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .sidebar-refresh-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .sidebar-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 1rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 1rem;
        }

        .sidebar-toggle:hover {
            background: var(--bg-tertiary);
            border-color: var(--primary-color);
        }

        .sidebar-toggle.active {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border-color: var(--primary-color);
        }

        .sidebar-toggle-text {
            font-weight: 500;
        }

        .sidebar-toggle-icon {
            transition: transform 0.3s ease;
        }

        .sidebar-toggle.active .sidebar-toggle-icon {
            transform: rotate(180deg);
        }

        .sidebar-history-list {
            max-height: 400px;
            overflow-y: auto;
        }

        .sidebar-history-item {
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.3s ease;
            background: var(--bg-primary);
            position: relative;
        }

        .sidebar-history-item:hover {
            border-color: var(--primary-color);
            background: rgba(37, 99, 235, 0.05);
        }

        .sidebar-history-item:hover .sidebar-history-delete {
            opacity: 1;
        }

        .sidebar-history-content {
            padding-right: 2rem;
        }

        .sidebar-history-title {
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .sidebar-history-meta {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .sidebar-history-delete {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            background: transparent;
            border: none;
            color: var(--text-muted);
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0;
        }

        .sidebar-history-delete:hover {
            background: var(--error-color);
            color: white;
        }

        /* 历史搜索记录样式 */
        .search-history-section {
            margin-bottom: 1.5rem;
        }

        .search-history-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.75rem;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 0.25rem;
        }

        .search-history-item:hover {
            background: var(--bg-secondary);
        }

        .search-history-text {
            font-size: 0.875rem;
            color: var(--text-secondary);
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .search-history-delete {
            background: transparent;
            border: none;
            color: var(--text-muted);
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0;
        }

        .search-history-item:hover .search-history-delete {
            opacity: 1;
        }

        .search-history-delete:hover {
            background: var(--error-color);
            color: white;
        }


        /* 搜索历史横向显示样式 */
        .search-history-horizontal {
            margin-top: 1rem;
            padding: 0 0.5rem;
            margin-bottom: 2rem; /* 增加底部间距，避免与卡片重叠 */
        }

        .search-history-container {
            max-width: 100%;
            overflow-x: auto;
            padding: 0.5rem 0;
        }

        .search-history-items {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            min-height: 40px;
        }

        .search-history-item-horizontal {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-full);
            padding: 0.5rem 1rem;
            font-size: 0.875rem;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            flex-shrink: 0;
            min-width: fit-content;
        }

        .search-history-item-horizontal:hover {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .search-history-text-horizontal {
            font-weight: 500;
        }

        .search-history-delete-horizontal {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.75rem;
        }

        .search-history-delete-horizontal:hover {
            background: var(--error-color);
            color: white;
            transform: scale(1.1);
        }

        .search-history-empty {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            color: var(--text-muted);
            font-size: 0.875rem;
            padding: 1rem;
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            border: 1px dashed var(--border-color);
        }

        .search-history-empty i {
            font-size: 1rem;
        }

        /* 侧边栏遮罩 */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .sidebar-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        /* 侧边栏切换按钮 */
        .sidebar-toggle-btn {
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 1.25rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: var(--radius-lg);
        }

        .sidebar-toggle-btn:hover {
            background: var(--bg-secondary);
            color: var(--primary-color);
        }

        /* 语音通话按钮 */
        .chat-header-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .voice-call-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            font-size: 1.1rem;
        }

        .voice-call-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.05);
        }

        /* 语音通话模态框 */
        .voice-call-modal {
            border: none;
            border-radius: var(--radius-2xl);
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            overflow: hidden;
            min-height: 500px;
        }
        
        /* 视频头像样式 */
        .character-avatar-video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 2;
        }
        
        .character-avatar-large {
            position: relative;
            overflow: hidden;
        }

        .voice-call-header {
            text-align: center;
            padding: 2.5rem 2rem 1.5rem;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
            border-radius: 20px 20px 0 0;
            position: relative;
        }

        .voice-call-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        }

        .character-avatar-large {
            margin: 0 auto 1.5rem;
            width: 160px;
            height: 160px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(20px) saturate(180%);
            border: 4px solid rgba(255, 255, 255, 0.4);
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.1),
                0 4px 16px rgba(0, 0, 0, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            position: relative;
            overflow: hidden;
        }

        .character-avatar-large::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, 
                transparent 30%, 
                rgba(255, 255, 255, 0.1) 50%, 
                transparent 70%
            );
            animation: avatarShine 3s ease-in-out infinite;
            z-index: 1;
        }

        @keyframes avatarShine {
            0%, 100% {
                transform: translateX(-100%) translateY(-100%) rotate(45deg);
            }
            50% {
                transform: translateX(100%) translateY(100%) rotate(45deg);
            }
        }

        .character-avatar-img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            font-weight: 700;
            position: relative;
            z-index: 2;
            box-shadow: 
                0 4px 16px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .character-name {
            margin: 0 0 0.8rem 0;
            font-size: 1.8rem;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.95);
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            letter-spacing: 0.02em;
        }

        .call-status {
            margin: 0;
            opacity: 0.9;
            font-size: 1.1rem;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.85);
            background: rgba(255, 255, 255, 0.1);
            padding: 0.5rem 1rem;
            border-radius: 20px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            display: inline-block;
            min-width: 200px;
        }

        .voice-call-content {
            padding: 2.5rem 2rem;
            min-height: 220px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
            position: relative;
        }

        .voice-call-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        }

        /* 语音波形动画 */
        .voice-wave-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            height: 120px;
            padding: 1rem;
        }

        .voice-wave {
            width: 6px;
            height: 30px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
            border-radius: 3px;
            animation: wave 1.2s ease-in-out infinite;
            box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
        }

        .voice-wave:nth-child(1) { animation-delay: 0s; }
        .voice-wave:nth-child(2) { animation-delay: 0.1s; }
        .voice-wave:nth-child(3) { animation-delay: 0.2s; }
        .voice-wave:nth-child(4) { animation-delay: 0.3s; }
        .voice-wave:nth-child(5) { animation-delay: 0.4s; }

        @keyframes wave {
            0%, 40%, 100% {
                transform: scaleY(1);
                opacity: 0.6;
            }
            20% {
                transform: scaleY(3);
                opacity: 1;
            }
        }

        /* AI回复文字显示区域 */
        .ai-response-text {
            width: 100%;
            max-height: 200px;
            overflow-y: auto;
            padding: 1rem;
            background: rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-lg);
            backdrop-filter: blur(10px);
        }

        .response-content {
            font-size: 1rem;
            line-height: 1.6;
            white-space: pre-wrap;
        }

        /* 语音通话控制按钮 */
        .voice-call-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 2.5rem;
            padding: 2.5rem 2rem;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
            border-radius: 0 0 20px 20px;
            position: relative;
        }

        .voice-call-controls::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        }

        .control-btn {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(20px) saturate(180%);
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.1),
                0 4px 16px rgba(0, 0, 0, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }

        .control-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                rgba(255, 255, 255, 0.05) 50%, 
                rgba(255, 255, 255, 0.1) 100%
            );
            border-radius: 50%;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .control-btn:hover {
            transform: scale(1.15) translateY(-2px);
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.15),
                0 6px 20px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .control-btn:hover::before {
            opacity: 1;
        }

        .control-btn:active {
            transform: scale(1.05) translateY(0);
        }

        /* 麦克风按钮 */
        .mic-btn {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
            color: white;
            border: 3px solid rgba(255, 255, 255, 0.4);
        }

        .mic-btn.active {
            background: linear-gradient(135deg, #10a37f, #0d8b6c);
            border-color: #10a37f;
            box-shadow: 
                0 8px 32px rgba(16, 163, 127, 0.3),
                0 4px 16px rgba(16, 163, 127, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .mic-btn.muted {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            border-color: #ef4444;
            box-shadow: 
                0 8px 32px rgba(239, 68, 68, 0.3),
                0 4px 16px rgba(239, 68, 68, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        /* 麦克风波形指示器 */
        .mic-wave-indicator {
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 2px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .mic-btn.speaking .mic-wave-indicator {
            opacity: 1;
        }

        .wave-bar {
            width: 3px;
            height: 8px;
            background: white;
            border-radius: 1.5px;
            animation: micWave 0.8s ease-in-out infinite;
        }

        .wave-bar:nth-child(1) { animation-delay: 0s; }
        .wave-bar:nth-child(2) { animation-delay: 0.1s; }
        .wave-bar:nth-child(3) { animation-delay: 0.2s; }
        .wave-bar:nth-child(4) { animation-delay: 0.3s; }

        @keyframes micWave {
            0%, 100% {
                transform: scaleY(1);
            }
            50% {
                transform: scaleY(2);
            }
        }

        /* 挂断按钮 */
        .hangup-btn {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
            border: 3px solid #ef4444;
        }

        .hangup-btn:hover {
            background: linear-gradient(135deg, #dc2626, #b91c1c);
            border-color: #dc2626;
            box-shadow: 
                0 8px 32px rgba(239, 68, 68, 0.4),
                0 4px 16px rgba(239, 68, 68, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        /* 文字显示按钮 */
        .text-btn {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
            color: white;
            border: 3px solid rgba(255, 255, 255, 0.4);
        }

        .text-btn.active {
            background: linear-gradient(135deg, #6366f1, #4f46e5);
            border-color: #6366f1;
            box-shadow: 
                0 8px 32px rgba(99, 102, 241, 0.3),
                0 4px 16px rgba(99, 102, 241, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }


        /* 最小化控制 */
        .minimized-controls {
            position: fixed;
            bottom: 20px;
            left: 20px;
            right: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 1060;
        }

        .copy-btn {
            background: rgba(255, 255, 255, 0.9);
            color: var(--text-primary);
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: var(--radius-lg);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-lg);
        }

        .copy-btn:hover {
            background: white;
            transform: translateY(-2px);
        }

        .mini-control-buttons {
            display: flex;
            gap: 0.75rem;
        }

        .mini-control-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-lg);
        }

        .mic-btn-mini {
            background: rgba(255, 255, 255, 0.9);
            color: var(--text-primary);
        }

        .mic-btn-mini.active {
            background: var(--success-color);
            color: white;
        }

        .mic-btn-mini.muted {
            background: var(--error-color);
            color: white;
        }

        .hangup-btn-mini {
            background: var(--error-color);
            color: white;
        }

        .text-btn-mini {
            background: rgba(255, 255, 255, 0.9);
            color: var(--text-primary);
        }

        .text-btn-mini.active {
            background: var(--accent-color);
            color: white;
        }

        /* 语音通话状态动画 */
        .voice-call-modal.listening .voice-wave-container {
            animation: pulse 2s ease-in-out infinite;
        }

        .voice-call-modal.speaking .character-avatar-large {
            animation: speakingPulse 1s ease-in-out infinite;
        }

        /* 打断按钮样式 */
        .interrupt-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            padding: 0.6rem;
            background: rgba(255, 255, 255, 0.06);
            border-radius: var(--radius-sm);
            margin: 0.3rem auto;
            max-width: 140px;
            position: absolute;
            top: 45%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 5;
        }

        .interrupt-info {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            font-size: 0.7rem;
            opacity: 0.85;
            white-space: nowrap;
        }

        .interrupt-info i {
            font-size: 0.8rem;
            color: #ffd700;
        }

        .interrupt-btn {
            background: linear-gradient(135deg, #ff6b6b, #ee5a52);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            padding: 0.35rem 0.7rem;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
            min-width: 60px;
            justify-content: center;
        }

        .interrupt-btn:hover {
            background: linear-gradient(135deg, #ff5252, #e53935);
            transform: translateY(-1px);
            box-shadow: 0 3px 12px rgba(255, 107, 107, 0.3);
        }

        .interrupt-btn:active {
            transform: translateY(0);
        }

        .interrupt-btn i {
            font-size: 0.8rem;
        }

        @keyframes speakingPulse {
            0%, 100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
            }
            50% {
                transform: scale(1.05);
                box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
            }
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .voice-call-header {
                padding: 2rem 1.5rem 1rem;
            }
            
            .character-avatar-large {
                width: 140px;
                height: 140px;
                margin-bottom: 1rem;
            }
            
            .character-name {
                font-size: 1.6rem;
                margin-bottom: 0.6rem;
            }
            
            .call-status {
                font-size: 1rem;
                padding: 0.4rem 0.8rem;
                min-width: 160px;
            }
            
            .voice-call-content {
                padding: 2rem 1.5rem;
                min-height: 180px;
            }
            
            .voice-wave-container {
                height: 100px;
                gap: 0.3rem;
            }
            
            .voice-wave {
                width: 5px;
                height: 25px;
            }
            
            .voice-call-controls {
                gap: 1.5rem;
                padding: 2rem 1.5rem;
            }
            
            .control-btn {
                width: 70px;
                height: 70px;
                font-size: 1.5rem;
            }
        }
        
        @media (max-width: 480px) {
            .character-avatar-large {
                width: 120px;
                height: 120px;
            }
            
            .character-name {
                font-size: 1.4rem;
            }
            
            .call-status {
                font-size: 0.9rem;
                min-width: 140px;
            }
            
            .voice-call-controls {
                gap: 1rem;
                padding: 1.5rem 1rem;
            }
            
            .control-btn {
                width: 60px;
                height: 60px;
                font-size: 1.3rem;
            }
        }
    </style>
</head>
<body class="modern-body">
    <!-- 背景装饰元素 -->
    <div class="modern-bg-decoration"></div>
    
    <!-- 背景粒子效果 -->
    <div id="particles-js"></div>
    
    <!-- 侧边栏遮罩 -->
    <div class="sidebar-overlay" id="sidebarOverlay" onclick="closeSidebar()"></div>

    <!-- 左侧侧边栏 -->
    <div class="sidebar" id="sidebar">
        <div class="sidebar-header">
            <div class="sidebar-title">
                <div class="sidebar-logo">解</div>
                <span>解忧</span>
            </div>
            <button class="sidebar-close-btn" onclick="closeSidebar()">
                <i class="bi bi-x-lg"></i>
            </button>
        </div>
        <div class="sidebar-content">
            <!-- 搜索框 -->
            <div class="sidebar-section">
                <div class="sidebar-search">
                    <i class="bi bi-search"></i>
                    <input type="text" placeholder="搜索历史对话/智能体" class="sidebar-search-input" id="sidebarSearchInput">
                </div>
            </div>

            <!-- 历史搜索记录 -->
            <div class="sidebar-section search-history-section">
                <div class="sidebar-section-header" onclick="app.toggleSection('searchHistory')">
                    <h4 class="sidebar-section-title">最近搜索</h4>
                    <div class="sidebar-section-actions">
                        <button class="sidebar-refresh-btn" onclick="app.clearSearchHistory(event)">
                            <i class="bi bi-trash"></i>
                        </button>
                        <i class="sidebar-toggle-icon bi bi-chevron-down"></i>
                    </div>
                </div>
                <div id="searchHistoryList" class="sidebar-content-list" style="display: none;">
                    <div class="text-center text-muted py-3">
                        <i class="bi bi-search fs-4 mb-2"></i>
                        <p>暂无搜索记录</p>
                        <small>搜索后记录将显示在这里</small>
                    </div>
                </div>
                <div id="searchHistoryPagination" class="sidebar-pagination" style="display: none;">
                    <button class="sidebar-pagination-btn" onclick="app.loadMoreSearchHistory()">
                        <i class="bi bi-chevron-down"></i>
                        <span>加载更多</span>
                    </button>
                </div>
            </div>


            <!-- 全部人物 -->
            <div class="sidebar-section">
                <div class="sidebar-section-header" onclick="app.toggleSection('allCharacters')">
                    <h4 class="sidebar-section-title">全部人物</h4>
                    <div class="sidebar-section-actions">
                        <button class="sidebar-refresh-btn" onclick="app.refreshAllCharacters(event)" title="刷新角色数据">
                            <i class="bi bi-arrow-clockwise"></i>
                        </button>
                        <i class="sidebar-toggle-icon bi bi-chevron-down"></i>
                    </div>
                </div>
                <div id="allCharactersList" class="sidebar-content-list" style="display: none;">
                    <div class="text-center text-muted py-3">
                        <i class="bi bi-grid-3x3-gap fs-4 mb-2"></i>
                        <p>加载中...</p>
                        <small>正在获取人物列表</small>
                    </div>
                </div>
                <div id="allCharactersPagination" class="sidebar-pagination" style="display: none;">
                    <button class="sidebar-pagination-btn" onclick="app.loadMoreAllCharacters()">
                        <i class="bi bi-chevron-down"></i>
                        <span>加载更多</span>
                    </button>
                </div>
            </div>

            <!-- 对话历史 -->
            <div class="sidebar-section">
                <div class="sidebar-section-header" onclick="app.toggleSection('chatHistory')">
                    <h4 class="sidebar-section-title">最近对话</h4>
                    <div class="sidebar-section-actions">
                        <button class="sidebar-refresh-btn" onclick="app.refreshChatHistory(event)" title="刷新聊天历史">
                            <i class="bi bi-arrow-clockwise"></i>
                        </button>
                        <i class="sidebar-toggle-icon bi bi-chevron-down"></i>
                    </div>
                </div>
                <div id="sidebarHistoryList" class="sidebar-content-list" style="display: none;">
                    <div class="text-center text-muted py-3">
                        <i class="bi bi-chat-dots fs-4 mb-2"></i>
                        <p>暂无对话历史</p>
                        <small>开始与AI角色对话后，历史记录将显示在这里</small>
                    </div>
                </div>
                <div id="chatHistoryPagination" class="sidebar-pagination" style="display: none;">
                    <button class="sidebar-pagination-btn" onclick="app.loadMoreChatHistory()">
                        <i class="bi bi-chevron-down"></i>
                        <span>加载更多</span>
                    </button>
                </div>
            </div>
        </div>
    </div>

    <div class="app-container">
        <!-- 顶部导航栏 -->
        <nav class="navbar">
            <div class="container">
                <div class="navbar-content">
                    <!-- 左侧按钮区域 -->
                    <div class="navbar-left">
                        <button class="sidebar-toggle-btn" onclick="toggleSidebar()" title="打开侧边栏">
                            <i class="bi bi-list"></i>
                        </button>
                        <div class="model-selector-container">
                            <div class="model-selector" onclick="toggleModelDropdown()">
                                <i class="bi bi-cpu"></i>
                                <span id="currentModelDisplay">GLM-4</span>
                                <i class="bi bi-chevron-down"></i>
                            </div>
                            <div class="model-dropdown" id="modelDropdown">
                                <div class="model-dropdown-header">
                                    <span>选择模型</span>
                                    <button class="model-dropdown-close" onclick="closeModelDropdown()">
                                        <i class="bi bi-x"></i>
                                    </button>
                                </div>
                                <div class="model-dropdown-content" id="modelList">
                                    <!-- 模型列表将通过JavaScript动态加载 -->
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 中间标题区域 - 已移除 -->
                    
                    <!-- 右侧用户区域 -->
                    <div class="navbar-right">
                        <div class="user-center-top-right">
                            <!-- 已登录状态 - 用户头像和下拉菜单 -->
                            <div id="userInfo" class="hidden">
                                <div class="user-avatar-container" onclick="toggleUserDropdown()">
                                    <div class="user-avatar">
                                        <i class="bi bi-person-fill"></i>
                                    </div>
                                    <span class="user-name" id="username"></span>
                                    <i class="bi bi-chevron-down user-dropdown-arrow"></i>
                                </div>
                                
                                <!-- 用户下拉菜单 -->
                                <div class="user-dropdown" id="userDropdown">
                                    <!-- 用户信息头部 -->
                                    <div class="user-dropdown-header">
                                        <div class="user-profile">
                                            <div class="user-avatar-large">
                                                <i class="bi bi-person-fill"></i>
                                                <div class="vip-badge">VIP</div>
                                            </div>
                                            <div class="user-info">
                                                <div class="user-name-large" id="usernameLarge"></div>
                                                <div class="user-status">非会员</div>
                                            </div>
                                            <div class="user-actions-small">
                                                <button class="btn-icon" title="编辑">
                                                    <i class="bi bi-pencil"></i>
                                                </button>
                                                <button class="btn-icon" title="复制">
                                                    <i class="bi bi-files"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <!-- 用户菜单项 -->
                                    <div class="user-dropdown-content">
                                        <a href="#" class="user-dropdown-item">
                                            <i class="bi bi-person"></i>
                                            <span>个人资料</span>
                                        </a>
                                        <a href="#" class="user-dropdown-item">
                                            <i class="bi bi-gear"></i>
                                            <span>设置</span>
                                        </a>
                                        <a href="#" class="user-dropdown-item">
                                            <i class="bi bi-question-circle"></i>
                                            <span>帮助中心</span>
                                        </a>
                                        <div class="user-dropdown-divider"></div>
                                        <a href="#" class="user-dropdown-item" onclick="logout()">
                                            <i class="bi bi-box-arrow-right"></i>
                                            <span>退出登录</span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- 未登录状态 - 登录和注册按钮 -->
                            <div id="loginButtons" class="login-buttons">
                                <button class="btn-login" onclick="showLoginModal()">登录</button>
                                <button class="btn-register" onclick="showRegisterModal()">注册</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </nav>

        
        <!-- 主内容区域 -->
        <main class="main-content">
            <div class="container">
                <!-- 欢迎区域 -->
                <div class="modern-welcome animate__animated animate__fadeIn">
                    <h1 class="modern-title">
                        <span class="title-main">解忧</span>
                        <span class="title-separator">——</span>
                        <span class="title-sub">让心声被听见</span>
                    </h1>
                    <p class="modern-subtitle">
                        <span class="subtitle-line">「孤独不是沉默，而是无人聆听。</span><br>
                        <span class="subtitle-line">解忧，用声音让心灵找到回响。」</span>
                    </p>
                </div>

                <!-- 搜索框 -->
                <div class="modern-search-container">
                    <div class="modern-search-wrapper">
                        <input type="text" class="modern-search-box" id="searchInput" placeholder="搜索AI人物，如：苏格拉底、达芬奇、李白..." autocomplete="off">
                        <i class="bi bi-search modern-search-icon"></i>
                        <button class="modern-search-btn" id="searchBtn" onclick="app.searchCharacters()">
                            <i class="bi bi-search"></i>
                        </button>
                        <button class="search-clear-btn" id="searchClearBtn" onclick="clearSearch()">
                            <i class="bi bi-x"></i>
                        </button>
                    </div>
                    
                    <!-- 搜索历史横向显示区域 -->
                    <div class="search-history-horizontal" id="searchHistoryHorizontal" style="display: none;">
                        <div class="search-history-container">
                            <div class="search-history-items" id="searchHistoryItems">
                                <!-- 搜索历史项将通过JavaScript动态加载 -->
                            </div>
                        </div>
                    </div>
                    
                    <!-- 搜索建议下拉菜单 -->
                    <div class="search-suggestions" id="searchSuggestions">
                        <div class="search-suggestions-content" id="searchSuggestionsContent">
                            <!-- 搜索建议内容将通过JavaScript动态加载 -->
                        </div>
                    </div>
                </div>

                <!-- 功能建议按钮 -->
                <div class="modern-feature-buttons">
                    <button class="modern-feature-btn" onclick="suggestQuery('古代哲学家')">
                        <i class="bi bi-mortarboard"></i>
                        古代哲学家
                    </button>
                    <button class="modern-feature-btn" onclick="suggestQuery('文学巨匠')">
                        <i class="bi bi-book"></i>
                        文学巨匠
                    </button>
                    <button class="modern-feature-btn" onclick="suggestQuery('科学家')">
                        <i class="bi bi-lightbulb"></i>
                        科学家
                    </button>
                    <button class="modern-feature-btn" onclick="suggestQuery('艺术大师')">
                        <i class="bi bi-palette"></i>
                        艺术大师
                    </button>
                </div>

                <!-- 精选人物卡片区域 -->
                <div id="featuredCharacters" class="modern-character-grid">
                    <!-- 精选人物卡片将通过JavaScript动态生成 -->
                </div>

                <!-- 换一批按钮 -->
                <div class="modern-refresh-section">
                    <button class="modern-refresh-btn" onclick="refreshCharacters()">
                        <i class="bi bi-arrow-clockwise"></i>
                        换一批
                    </button>
                </div>

                <!-- 角色列表 -->
                <div id="characterList" class="modern-character-grid hidden">
                    <!-- 角色卡片将通过JavaScript动态生成 -->
                </div>

                <!-- 聊天界面 -->
                <div id="chatInterface" class="modern-chat-container hidden">
                    <!-- 聊天头部 -->
                    <div class="modern-chat-header">
                        <div class="modern-chat-character-info">
                            <div id="currentCharacterAvatar" class="modern-chat-character-avatar"></div>
                            <div class="modern-chat-character-details">
                                <h4 id="currentCharacterName"></h4>
                                <p id="currentCharacterDesc"></p>
                            </div>
                        </div>
                        <div class="modern-chat-actions">
                            <!-- 对话管理按钮将通过JavaScript动态添加 -->
                            <button class="modern-chat-btn" onclick="closeChat()" title="关闭聊天">
                                <i class="bi bi-x-lg"></i>
                            </button>
                        </div>
                    </div>

                    <!-- 聊天消息区域 -->
                    <div id="chatMessages" class="modern-chat-messages">
                        <!-- 消息将通过JavaScript动态生成 -->
                    </div>

                    <!-- 输入区域 -->
                    <div class="modern-chat-input-area">
                        <!-- AI技能选择和语音识别策略 -->
                        <div class="modern-ai-skills">
                            <div class="modern-skill-selector active" data-skill="memory">记忆管理</div>
                            <div class="modern-skill-selector" data-skill="knowledge">知识问答</div>
                            <div class="modern-skill-selector" data-skill="emotion">情感感知</div>
                            <div class="modern-skill-selector" data-skill="creative">创意写作</div>
                            <div class="modern-skill-selector" data-skill="analyze">深度分析</div>
                            
                            <!-- 语音识别策略选择按钮 -->
                            <div class="voice-strategy-selector">
                                <button class="voice-strategy-btn" id="voiceStrategyBtn" title="点击切换语音识别引擎">
                                    <i class="bi bi-mic-fill"></i>
                                    <span class="strategy-name" id="strategyName">加载中...</span>
                                    <i class="bi bi-chevron-down"></i>
                                </button>
                                <div class="strategy-dropdown" id="strategyDropdown">
                                    <!-- 策略选项将通过JavaScript动态填充 -->
                                </div>
                            </div>
                        </div>

                        <!-- 输入框和按钮 -->
                        <div class="modern-input-group">
                            <textarea class="modern-message-input" id="messageInput" placeholder="输入你想说的话..." rows="1"></textarea>
                            <div class="modern-input-actions">
                                <button class="modern-btn-voice" id="voiceCallBtn" onclick="startVoiceCall()" title="语音通话">
                                    <i class="bi bi-telephone"></i>
                                </button>
                                <button class="modern-btn-voice" id="voiceBtn" onclick="toggleVoiceRecording()" title="语音转文字">
                                    <i class="bi bi-mic"></i>
                                </button>
                                <button class="modern-btn-send" onclick="sendMessage()">
                                    <i class="bi bi-send"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <!-- 登录模态框 -->
    <div class="modal fade" id="loginModal" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content modern-modal-content">
                <div class="modal-header modern-modal-header">
                    <h5 class="modal-title modern-modal-title">用户登录</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body modern-modal-body">
                    <form id="loginForm">
                        <div class="mb-3">
                            <label for="loginUsernameOrEmail" class="form-label">用户名或邮箱</label>
                            <input type="text" class="form-control modern-form-control" id="loginUsernameOrEmail" required>
                        </div>
                        <div class="mb-3">
                            <label for="loginPassword" class="form-label">密码</label>
                            <input type="password" class="form-control modern-form-control" id="loginPassword" required>
                        </div>
                        <div id="loginError" class="text-danger mb-3 hidden"></div>
                        <button type="submit" class="btn modern-btn-primary w-100">登录</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- 注册模态框 -->
    <div class="modal fade" id="registerModal" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content modern-modal-content">
                <div class="modal-header modern-modal-header">
                    <h5 class="modal-title modern-modal-title">用户注册</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body modern-modal-body">
                    <form id="registerForm">
                        <div class="mb-3">
                            <label for="registerUsername" class="form-label">用户名</label>
                            <input type="text" class="form-control modern-form-control" id="registerUsername" required>
                        </div>
                        <div class="mb-3">
                            <label for="registerEmail" class="form-label">邮箱</label>
                            <input type="email" class="form-control modern-form-control" id="registerEmail" required>
                        </div>
                        <div class="mb-3">
                            <label for="registerPassword" class="form-label">密码</label>
                            <input type="password" class="form-control modern-form-control" id="registerPassword" required>
                        </div>
                        <div class="mb-3">
                            <label for="registerNickname" class="form-label">昵称（可选）</label>
                            <input type="text" class="form-control modern-form-control" id="registerNickname">
                        </div>
                        <div id="registerError" class="text-danger mb-3 hidden"></div>
                        <button type="submit" class="btn modern-btn-primary w-100">注册</button>
                    </form>
                </div>
            </div>
        </div>
    </div>


    <!-- 语音通话模态框 -->
    <div class="modal fade" id="voiceCallModal" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content voice-call-modal">
                <div class="voice-call-header">
                    <div class="character-avatar-large">
                        <div id="voiceCallCharacterAvatar" class="character-avatar-img"></div>
                        <video id="voiceCallCharacterVideo" class="character-avatar-video" 
                               autoplay loop muted style="display: none;">
                            <source src="" type="video/mp4">
                            您的浏览器不支持视频播放。
                        </video>
                    </div>
                    <h4 id="voiceCallCharacterName" class="character-name"></h4>
                    <p class="call-status" id="callStatus">请开始说话...</p>
                </div>
                
                <div class="voice-call-content" id="voiceCallContent">
                    <!-- 语音波形动画 -->
                    <div class="voice-wave-container" id="voiceWaveContainer">
                        <div class="voice-wave"></div>
                        <div class="voice-wave"></div>
                        <div class="voice-wave"></div>
                        <div class="voice-wave"></div>
                        <div class="voice-wave"></div>
                    </div>
                    
                    <!-- AI回复文字显示区域 -->
                    <div class="ai-response-text hidden" id="aiResponseText">
                        <div class="response-content" id="responseContent"></div>
                    </div>
                    
                    <!-- AI回答时的打断按钮 -->
                    <div class="interrupt-section hidden" id="interruptSection">
                        <div class="interrupt-info">
                            <i class="bi bi-volume-up"></i>
                            <span>AI正在回答，可以打断</span>
                        </div>
                        <button class="interrupt-btn" id="interruptBtn" onclick="interruptAiResponse()">
                            <i class="bi bi-stop-circle"></i>
                            <span>打断</span>
                        </button>
                    </div>
                </div>
                
                <!-- 语音通话控制按钮 -->
                <div class="voice-call-controls" id="voiceCallControls">
                    <!-- 麦克风按钮 -->
                    <button class="control-btn mic-btn" id="micBtn" onclick="toggleMicrophone()">
                        <i class="bi bi-mic"></i>
                        <div class="mic-wave-indicator" id="micWaveIndicator">
                            <div class="wave-bar"></div>
                            <div class="wave-bar"></div>
                            <div class="wave-bar"></div>
                            <div class="wave-bar"></div>
                        </div>
                    </button>
                    
                    <!-- 挂断按钮 -->
                    <button class="control-btn hangup-btn" onclick="endVoiceCall()">
                        <i class="bi bi-telephone-x"></i>
                    </button>
                    
                    <!-- 文字显示按钮 -->
                    <button class="control-btn text-btn" id="textBtn" onclick="toggleTextDisplay()">
                        <i class="bi bi-chat-text"></i>
                    </button>
                </div>
                
                <!-- 最小化时的控制按钮和复制按钮 -->
                <div class="minimized-controls hidden" id="minimizedControls">
                    <button class="copy-btn" onclick="copyAiResponse()">
                        <i class="bi bi-clipboard"></i>
                        复制
                    </button>
                    <div class="mini-control-buttons">
                        <button class="mini-control-btn mic-btn-mini" onclick="toggleMicrophone()">
                            <i class="bi bi-mic"></i>
                        </button>
                        <button class="mini-control-btn hangup-btn-mini" onclick="endVoiceCall()">
                            <i class="bi bi-telephone-x"></i>
                        </button>
                        <button class="mini-control-btn text-btn-mini" onclick="toggleTextDisplay()">
                            <i class="bi bi-chat-text"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <!-- 自定义JavaScript -->
    <script src="js/app.js"></script>
    
    <!-- 现代化效果初始化 -->
    <script>
        // 初始化粒子效果
        function initParticles() {
            if (typeof particlesJS !== 'undefined') {
                const particlesContainer = document.getElementById('particles-js');
                if (!particlesContainer) {
                    console.warn('Particles container not found');
                    return;
                }
                
                particlesJS('particles-js', {
                    particles: {
                        number: {
                            value: 50,
                            density: {
                                enable: true,
                                value_area: 800
                            }
                        },
                        color: {
                            value: ['#10a37f', '#6366f1', '#f59e0b']
                        },
                        shape: {
                            type: 'circle',
                            stroke: {
                                width: 0,
                                color: '#000000'
                            }
                        },
                        opacity: {
                            value: 0.1,
                            random: false,
                            anim: {
                                enable: true,
                                speed: 1,
                                opacity_min: 0.05,
                                sync: false
                            }
                        },
                        size: {
                            value: 3,
                            random: true,
                            anim: {
                                enable: true,
                                speed: 2,
                                size_min: 1,
                                sync: false
                            }
                        },
                        line_linked: {
                            enable: true,
                            distance: 150,
                            color: '#10a37f',
                            opacity: 0.05,
                            width: 1
                        },
                        move: {
                            enable: true,
                            speed: 1,
                            direction: 'none',
                            random: false,
                            straight: false,
                            out_mode: 'out',
                            bounce: false,
                            attract: {
                                enable: false,
                                rotateX: 600,
                                rotateY: 1200
                            }
                        }
                    },
                    interactivity: {
                        detect_on: 'canvas',
                        events: {
                            onhover: {
                                enable: true,
                                mode: 'grab'
                            },
                            onclick: {
                                enable: true,
                                mode: 'push'
                            },
                            resize: true
                        },
                        modes: {
                            grab: {
                                distance: 140,
                                line_linked: {
                                    opacity: 0.1
                                }
                            },
                            push: {
                                particles_nb: 4
                            }
                        }
                    },
                    retina_detect: true
                });
            } else {
                console.warn('Particles.js library not loaded');
            }
        }
        
        // 初始化Feather图标
        function initFeatherIcons() {
            if (typeof feather !== 'undefined') {
                feather.replace();
            }
        }
        
        // 初始化GSAP动画
        function initAnimations() {
            if (typeof gsap !== 'undefined') {
                // 等待DOM元素加载完成
                const checkElements = () => {
                    const title = document.querySelector('.modern-title');
                    const subtitle = document.querySelector('.modern-subtitle');
                    const searchContainer = document.querySelector('.modern-search-container');
                    
                    if (title && subtitle && searchContainer) {
                        // 欢迎标题动画
                        gsap.from('.modern-title', {
                            duration: 1.2,
                            y: 50,
                            opacity: 0,
                            ease: 'power3.out',
                            delay: 0.3
                        });
                        
                        // 副标题动画
                        gsap.from('.modern-subtitle', {
                            duration: 1,
                            y: 30,
                            opacity: 0,
                            ease: 'power2.out',
                            delay: 0.8
                        });
                        
                        // 搜索框动画
                        gsap.from('.modern-search-container', {
                            duration: 1,
                            y: 40,
                            opacity: 0,
                            ease: 'power2.out',
                            delay: 1.2
                        });
                        
                        // 功能按钮动画
                        gsap.from('.modern-feature-btn', {
                            duration: 0.8,
                            y: 20,
                            opacity: 0,
                            ease: 'power2.out',
                            delay: 1.5,
                            stagger: 0.1
                        });
                        
                        // 角色卡片动画
                        gsap.from('.modern-character-card', {
                            duration: 0.8,
                            y: 30,
                            opacity: 0,
                            ease: 'power2.out',
                            delay: 1.8,
                            stagger: 0.15
                        });
                    } else {
                        // 如果元素还没加载，等待100ms后重试
                        setTimeout(checkElements, 100);
                    }
                };
                
                checkElements();
            } else {
                console.warn('GSAP library not loaded');
            }
        }
        
        // 功能建议函数
        function suggestQuery(category) {
            const searchInput = document.getElementById('searchInput');
            if (searchInput) {
                searchInput.value = category;
                searchInput.focus();
                
                // 添加视觉反馈
                searchInput.classList.add('modern-pulse');
                setTimeout(() => {
                    searchInput.classList.remove('modern-pulse');
                }, 1000);
                
                // 触发搜索
                if (app && app.searchCharacters) {
                    app.searchCharacters(category, true);
                }
            }
        }
        
        // 增强搜索体验
        function enhanceSearchExperience() {
            const searchInput = document.getElementById('searchInput');
            const searchBtn = document.querySelector('.modern-search-btn');
            
            if (searchInput) {
                // 搜索输入动画
                searchInput.addEventListener('focus', function() {
                    if (typeof gsap !== 'undefined') {
                        gsap.to(this, {
                            duration: 0.3,
                            scale: 1.02,
                            ease: 'power2.out'
                        });
                    }
                });
                
                searchInput.addEventListener('blur', function() {
                    if (typeof gsap !== 'undefined') {
                        gsap.to(this, {
                            duration: 0.3,
                            scale: 1,
                            ease: 'power2.out'
                        });
                    }
                });
                
                // 实时显示/隐藏搜索按钮
                searchInput.addEventListener('input', function() {
                    if (searchBtn) {
                        if (this.value.trim()) {
                            searchBtn.classList.add('show');
                        } else {
                            searchBtn.classList.remove('show');
                        }
                    }
                });
            }
        }
        
        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 延迟初始化以确保所有库都加载完成
            setTimeout(function() {
                initParticles();
                initFeatherIcons();
                initAnimations();
                enhanceSearchExperience();
                
                // 显示缓存状态
                if (app) {
                    setTimeout(() => {
                        showCacheStatus();
                    }, 2000);
                }
            }, 500);
        });
        
        // 显示缓存状态
        function showCacheStatus() {
            if (!app) return;
            
            const cacheInfo = {
                characters: app.isCacheValid('characters') ? '有效' : '无效',
                chatHistory: app.isCacheValid('chatHistory') ? '有效' : '无效',
                searchHistory: app.isCacheValid('searchHistory') ? '有效' : '无效'
            };
            
            console.log('侧边栏缓存状态:', cacheInfo);
        }
        
        // 全局缓存管理函数
        function clearAllCache() {
            if (app) {
                app.clearAllSidebarCache();
                app.showToast('所有缓存已清除', 'success');
            }
        }
        
        function refreshAllCache() {
            if (app) {
                Promise.all([
                    app.forceRefreshData('characters'),
                    app.forceRefreshData('chatHistory'),
                    app.forceRefreshData('searchHistory')
                ]).then(() => {
                    app.showToast('所有数据已刷新', 'success');
                }).catch(error => {
                    console.error('刷新数据失败:', error);
                    app.showToast('刷新失败，请稍后重试', 'error');
                });
            }
        }
        
        // 窗口加载完成后确保初始化
        window.addEventListener('load', function() {
            setTimeout(function() {
                initParticles();
            }, 1000);
        });
    </script>
</body>
</html>